import { configureStore } from "@reduxjs/toolkit";
import { createWrapper } from "next-redux-wrapper";
import homeStore from "./modules/homeStore";

const store = configureStore({
  reducer: {
    home: homeStore,
  },
});

const storeWrapper = createWrapper(() => store);
export default storeWrapper;

// dispatch函数的类型
export type IAppDisPatch = typeof store.dispatch;
// rootState的类型
export type IAppRootState = ReturnType<typeof store.getState>;
